{% extends "base.html" %}

{% block title %}用户登录{% endblock %}

{% block navigation %}{% endblock %}

{% block footer %}{% endblock %}

{% block styles %}
    <style>
        body {
            background-color: #f8f9fa;
        }
        .login-container {
            max-width: 480px;
            margin: 140px auto;
            padding: 40px;
            border-radius: 16px;
            box-shadow: 0 0 20px rgba(0,0,0,0.1);
        }
        .login-logo {
            text-align: center;
            margin-bottom: 30px;
        }
        .login-logo img {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            padding: 10px;
            background: white;
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        }
        .form-floating {
            margin-bottom: 15px;
        }
        .alert {
            margin-top: 20px;
        }
    </style>
{% endblock %}

{% block content %}
<div class="container">
    <div class="login-container bg-white">
        <div class="login-logo">
            <img src="{{ url_for('static', filename='res/bookgoal.ico') }}" alt="Logo">
            <h3 class="mt-3">BK-VI-ROBOT</h3>
        </div>

        {% with messages = get_flashed_messages(with_categories=true) %}
            {% if messages %}
                {% for category, message in messages %}
                    <div class="alert alert-{{ category }}">{{ message }}</div>
                {% endfor %}
            {% endif %}
        {% endwith %}

        <form method="POST" action="{{ url_for('main.login') }}">
            <div class="form-floating">
                <input type="text" class="form-control" id="username" name="username" 
                       placeholder="Username" required autofocus>
                <label for="username">用户名</label>
            </div>
            <div class="form-floating">
                <input type="password" class="form-control" id="password" name="password" 
                       placeholder="Password" required>
                <label for="password">密码</label>
            </div>
            <button class="w-100 btn btn-lg btn-primary" type="submit">登录</button>
        </form>
    </div>
</div>
{% endblock %}
